package com.mall.controller;

import com.mall.pojo.Result;
import com.mall.service.subCateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/category/sub")
public class subCateController { //layout界面header层标题展示
    @Autowired
    private subCateService subCateService;
    @GetMapping
    public Result findAll() {
        return Result.success(subCateService.findAll());
    }
    @GetMapping("/{id}")
    public Result findById(@PathVariable Integer id) {
        return Result.success(subCateService.findById(id));
    }

}
